﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using Microsoft.Kinect;

namespace KinectServer
{
    [DataContract]
    class JSONEvents
    {
        private string evento;

        [DataMember(Name = "name")]
        public string name { get; set; }

        public JSONEvents(string evento)
        {
            this.name = evento;
        }

        internal string Serialize()
        {
            DataContractJsonSerializer serializer = new DataContractJsonSerializer(this.GetType());
            MemoryStream ms = new MemoryStream();
            serializer.WriteObject(ms, this);
            string retVal = Encoding.Default.GetString(ms.ToArray());
            ms.Dispose();
            return retVal;
        }
    }
}
